import request from '@/utils/request'

export const GetNestedMenus = () => {
  return request({
    url: `/admin/system/menu/findNestdMenus`,
    method: 'get',
  })
}

export const DeleteMenuById = id => {
  return request({
    url: `/admin/system/menu/deleteById/${id}`,
    method: 'delete',
  })
}

export const GetMenuById = id => {
  return request({
    url: `/admin/system/menu/getById/${id}`,
    method: 'get',
  })
}

export const UpdateMenuById = menu => {
  return request({
    url: `/admin/system/menu/updateById`,
    method: 'put',
    data: menu,
  })
}

export const SaveMenu = menu => {
  return request({
    url: `/admin/system/menu/save`,
    method: 'post',
    data: menu,
  })
}
